<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    手机号码：<input type="number" name="" id=""><button>发送</button>
    <script>
        var time = 3
        var btn = document.querySelector('button')
        var timer = btn.addEventListener('click', function () {
            btn.disabled = true
            setInterval(function () {
                if (time == 0) {
                    clearInterval(timer)
                    btn.innerText = '发送'
                    btn.disabled = false


                }
                else {
                    btn.innerText = '还剩下' + time + '秒'
                    time--
                }
            }, 1000)
            time = 3
        })
    </script>
</body>

</html>